package com.atguigu.tingshu.user.client;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.vo.base.user.UserInfo;
import com.atguigu.tingshu.vo.base.user.UserPaidTrack;
import com.atguigu.tingshu.user.client.impl.UserInfoDegradeFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(value = "service-user", fallback = UserInfoDegradeFeignClient.class)
public interface UserInfoFeignClient {
    @GetMapping("api/user/userInfo/getUserInfo/{id}")
    Result<UserInfo> getUserInfo(@PathVariable Long id);

    @GetMapping("api/user/userInfo/isPayAlbum/{albumId}")
    Result<Boolean> isPayAlbum(@PathVariable Long albumId);

    @GetMapping("api/user/userInfo/isPayTrack/{albumId}")
    Result<List<UserPaidTrack>> isPayTrack(@PathVariable Long albumId);

    @PostMapping("api/user/userInfo/updateVipStatus")
    Result updateVipStatus();
}
